package com.xuelang.pipeline.domain.pipeline.repository;


import com.xuelang.pipeline.client.common.result.PageRecord;
import com.xuelang.pipeline.client.pipeline.dto.PipelineInstanceQuery;
import com.xuelang.pipeline.domain.pipeline.PipelineInstance;

import java.util.List;

/**
 * <p>流水线实例仓库接口</p>
 *
 * @author : yixin.lys
 * @date : 2024-06-18 18:14
 **/
public interface PipelineInstanceRepository {

    /**
     * 根据查询条件分页获取流水线实例
     *
     * @param currentPage
     * @param pageSize
     * @param pipelineInstanceQuery
     * @return
     */
    PageRecord<PipelineInstance> pageByPipelineCode(long currentPage, long pageSize, PipelineInstanceQuery pipelineInstanceQuery);

    /**
     * 根据查询条件获取流水线实例
     *
     * @param pipelineInstanceQuery
     * @return
     */
    List<PipelineInstance> listByQuery(PipelineInstanceQuery pipelineInstanceQuery);


    /**
     * 新增流水线实例
     * @param pipelineInstance
     */
    void add(PipelineInstance pipelineInstance);


    /**
     * 更新流水线实例
     * @param pipelineInstance
     */
    void update(PipelineInstance pipelineInstance);


    /**
     * 根据id批量删除
     * @param idList
     */
    void removeByIds(List<String> idList);

    /**
     * 根据流水线code批量删除
     * @param codeList
     */
    void removeByCodes(List<String> codeList);

    /**
     * 根据流水线实例code查询流水线实例
     * @param pipelineInstanceCode
     * @return
     */
    PipelineInstance queryByCode(String pipelineInstanceCode);
}
